macro(load_qt qtVersion)
	# 自动调用moc，uic，rcc处理qt的扩展部分
	set(CMAKE_AUTOMOC ON)
	set(CMAKE_AUTOUIC ON)
	set(CMAKE_AUTORCC ON)

	if(${qtVersion} EQUAL 5)
		# 查询QT5模块
		find_package(Qt5 COMPONENTS Core Widgets Gui Concurrent SerialPort Sql Xlsx REQUIRED)
		set(QT_LIBS
			Qt5::Core 
			Qt5::Widgets 
			Qt5::Gui
			Qt5::Concurrent 
			Qt5::SerialPort 
			Qt5::Sql 
			Qt5::Xlsx 
		)
		# 添加QT头文件
		include_directories(
			${Qt5Core_INCLUDE_DIRS}
			${Qt5Widgets_INCLUDE_DIRS}
			${Qt5Gui_INCLUDE_DIRS}
			${Qt5Concurrent_INCLUDE_DIRS}
			${Qt5SerialPort_INCLUDE_DIRS}
			${Qt5Sql_INCLUDE_DIRS}
			${Qt5Xlsx_INCLUDE_DIRS}
			${Qt5WebEngine_INCLUDE_DIRS}
			${Qt5WebEngineWidgets_INCLUDE_DIRS}
		)
	endif()
	# 添加‘QT_MESSAGELOGCONTEXT’宏，输出日志信息
	add_compile_definitions(QT_MESSAGELOGCONTEXT)

endmacro()